<?php
/**
 * Return specified value if string is empty.
 *
 * @author Anton Danilchenko <anton.danilchenko@gmail.com>
 */
class Templum_Helper_Default implements Templum_Helper_Interface {
	/**
	 * Return result of current helper.
	 *
	 * @param string $sData: processing string
	 * @param array $aParams: 0 - default value
	 */
	public function handle(&$sData, $aParams=array()) {
		// set default value if data empty
		if (empty($sData) AND isset($aParams[0]))
			$sData = $aParams[0];
	}
}